home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / diskbuf.zip / DISKBUF.DOC < prev    next >
Text File  |  1987-05-18  |  13KB  |  306 lines

  1.  
  2.  
  3.  
  4.                                      DISKBUF
  5.  
  6.                    A Program to Optimize the BUFFERS= Setting
  7.  
  8.                                        by
  9.  
  10.                                   W. G. Madison
  11.                         W.G. Madison and Associates, Ltd.
  12.                              8425 Greenbelt Rd. #101
  13.                                Greenbelt MD 20770
  14.                                   301/552-9309
  15.                              (CompuServe 73240,342)
  16.  
  17.                                   May 15, 1987
  18.  
  19.  
  20.         Acknowledgment: This program is based upon ideas gleaned from the 
  21.         public domain program THRASHER, by Monte Ferguson of Ravenna, OH.
  22.  
  23.         Disclaimer: This program is provided AS IS, with no claim for 
  24.         suitability for any particular purpose. Specifically, since the 
  25.         program is necessarily extremely disk intensive and therefore 
  26.         exercises the head positioning mechanism far more than is custom-
  27.         ary in normal use, the Author and W. G. Madison and Associates, 
  28.         Ltd. disclaim any and all responsibility for actual and/or con-
  29.         sequential damages to hardware and/or files resulting from the 
  30.         use of this program.
  31.  
  32.  
  33.         INTRODUCTION:
  34.  
  35.              All personal computers using the DOS operating system (PC-
  36.         DOS, MS-DOS, etc.) use buffered I/O when reading from or writing 
  37.         to the disk, unless the programmer who wrote the software being 
  38.         used went to great lengths to avoid it. The number of buffers 
  39.         used is specified in the file CONFIG.SYS, which is read at the 
  40.         time the computer is booted up.
  41.  
  42.              If you are not familiar with the CONFIG.SYS file or with the 
  43.         concept of buffered I/O, it is strongly suggested that you refer 
  44.         to your DOS reference manual before proceeding further.
  45.  
  46.              The problem of determining the proper number of buffers with 
  47.         which to configure a DOS computer is, at best, inadequately add-
  48.         ressed in most DOS reference manuals. Generally, the suggested 
  49.         approach is "Try a number, then use your computer, then try 
  50.         another number. Keep repeating this process until you are either 
  51.         fed up or have arrived at something which gives acceptable per-
  52.         formance." Some reference manuals give a suggested value to be 
  53.         used by those looking for an easy out. This suggested value may 
  54.         or may not yield performance which is close to optimum.
  55.  
  56.              DiskBuf provides a method for scanning through an entire 
  57.         range of values while you go out for coffee (or something 
  58.         stronger).
  59.  
  60.  
  61.                                    1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.         WHY WORRY ABOUT THE NUMBER OF BUFFERS?
  68.  
  69.              As might be expected, buffering uses RAM. Specifically, each 
  70.         buffer added to a DOS system uses 33 paragraphs (528 bytes) of 
  71.         RAM. Assuming that plenty of RAM is available, it might be tempt-
  72.         ing to take the approach, "Let's just set the number of buffers 
  73.         way up, and fly with that." Unfortunately, one can reach the 
  74.         point where more time is spent searching buffers for information 
  75.         than is necessary or desirable. A point of diminishing returns is 
  76.         reached.
  77.  
  78.              Similarly, too few buffers will cause the computer to go to 
  79.         the disk more often than necessary. And, since disk operations 
  80.         are dreadfully slow in comparison to memory operations, unaccept-
  81.         able performance degradation will result.
  82.  
  83.  
  84.         WHY USE THE DISKBUF PROGRAM TO SOLVE THE PROBLEM?
  85.  
  86.              Basically, without an intimate knowledge of the insides of 
  87.         DOS plus a penchant for solving complex mathematical problems, 
  88.         there are three feasible methods for attacking the problem. The 
  89.         first is to pick a number (based either upon your liking for 
  90.         indulging in Russian roulette, or upon recommendations from 
  91.         friends or the DOS reference manual) and put your trust in the 
  92.         tooth fairy as to the appropriateness of the number. The second 
  93.         is to try to determine the number by systematic trial and error, 
  94.         editing your CONFIG.SYS file over a period of time. The third 
  95.         method is to set up an automatic process which can sweep through 
  96.         a series of values, perform a realistic test with each value, and 
  97.         record the results for later analysis.
  98.  
  99.              The DISKBUF program permits this third approach to be taken 
  100.         easily. After using DISKBUF, you can readily determine the op-
  101.         timum number of buffers to be used, based not only upon time to 
  102.         perform the test but also upon the amount of RAM occupied by the 
  103.         buffers. You can decide, and have some rational basis for the 
  104.         decision, whether you are willing to sacrifice X bytes of addi-
  105.         tional RAM in order to gain an additional Y% performance improve-
  106.         ment from your disk operations.
  107.  
  108.              Sure beats flying by the seat of the pants, no?
  109.  
  110.  
  111.  
  112.         HOW DO I USE DISKBUF?
  113.  
  114.              Four files are included in the file DISKBUF.ARC. They are, 
  115.         respectively:
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.                                    2
  123.  
  124.  
  125.  
  126.                             DISKBUF.DOC  (This file)
  127.                             DISKBUF.COM  (The operational program)
  128.                             AUTOEXEC.BAT (A specimen AUTOEXEC file)
  129.                             PLOTBUF.COM  (A program to produce a screen
  130.                                          plot of the test results. 
  131.                                          Duplicates code contained in
  132.                                          DISKBUF.COM)
  133.  
  134.              Examine the AUTOEXEC.BAT file. You will see, as the last 
  135.         line of the file, the line invoking DISKBUF. In the REMark lines 
  136.         preceding this, you will see guidelines for setting the switch 
  137.         values to be passed to DISKBUF. The switches are:
  138.  
  139.                             /TARGET:  (Sets the disk to be tested)
  140.                             /MAXBUF:  (Sets the stopping point for the 
  141.                                       test)
  142.                             /MINBUF:  (Sets the starting point for the
  143.                                       test)
  144.                             /PLOT     (If present, a screen plot of the
  145.                                       test results will be produced)
  146.  
  147.              The first two switches, /TARGET: and /MAXBUF: are required; 
  148.         the other two, /MINBUF: and /PLOT are optional.
  149.  
  150.              /TARGET:xx     takes as an argument a valid disk device 
  151.         designator, with the appended colon being optional. This deter-
  152.         mines the device which is to be tested. (Required)
  153.  
  154.              /MAXBUF:nn     takes as an argument an integer between 1 and 
  155.         99, and determines the greatest number of buffers to be used in 
  156.         the test. (Required)
  157.  
  158.              /MINBUF:nn     also takes as an argument an integer between 
  159.         1 and 99, and determines the starting number of buffers to be 
  160.         used in the test. If this switch is omitted, a starting value of 
  161.         3 will be used. (Optional)
  162.  
  163.              /PLOT          determines by its presence or absence whether 
  164.         or not a screen plot of the test results will be produced at the 
  165.         completion of the test. NOTE: If your computer does not have a 
  166.         graphics card, this switch must not be included! (Optional)
  167.  
  168.  
  169.              To use DISKBUF, four steps are required.
  170.  
  171.              STEP 1.   Format a disk using the /S switch to make the disk 
  172.         bootable.
  173.  
  174.              STEP 2.   Edit the AUTOEXEC.BAT file, to invoke DISKBUF with 
  175.         the switch settings you want to be used.
  176.  
  177.              STEP 3.   Copy the edited AUTOEXEC.BAT file and the program 
  178.         file DISKBUF.COM onto the disk prepared at Step 1.
  179.  
  180.              STEP 4.   Re-boot your computer.
  181.  
  182.  
  183.                                    3
  184.  
  185.  
  186.  
  187.  
  188.              STEP 5.   Go to lunch, and come back in